<extend name="Public/common" />
<block name="content">
<div class="row">
	<div class="col-md-10 col-md-offset-1 m-b-md">
		<nav class="navbar m-t bg-white no-br">
			<div class="container-fluid">
			    <div class="navbar-header">
			      	<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#user-music-menu">
				        <span class="sr-only">Toggle navigation</span>
				        <span class="icon-bar"></span>
				        <span class="icon-bar"></span>
				        <span class="icon-bar"></span>
			      	</button>
				</div>

				<div class="collapse navbar-collapse" id="user-music-menu">
			      	<ul class="nav navbar-nav">
				        <li class=""><a href="<{:U('Message/index')}>">全部消息</a></li>
						<li class="dk"><a href="<{:U('Letter/index')}>">我的私信</a></li>
			      	</ul>
			      	
			    	<ul class="nav navbar-nav pull-right-lg ">
				        <li class=""><a href="<{:U('Music/audit')}>"  class="btn-del" data-url="<{:U('removeall')}>" href="JavaScript:void(0)">全部清空</a></li>
			      	</ul>
				</div>
			</div>
		</nav>
		<div class="row">
			<div class="col-md-12 m-b-md">
				<section class="panel panel-default">
					<if condition="$list">
					<section class="chat-list panel-body">
						<volist name="list" id="v">											
		            	<article class="chat-item left" id="chat-id-1">
		                	<a class="pull-left thumb-sm avatar" href="<{:U('Home/index',array('uid'=>$v['post_uid']))}>"><img alt="..." src="<{$v['post_uid']|get_user_avatar='64'}>"></a>
		                	<section class="chat-body">
		                		<div class="panel b-light text-sm m-b-none">
		                			<header class="panel-heading">                      
                          				<a href="<{:U('Home/index',array('uid'=>$v['post_uid']))}>">By <{$v['post_uname']}></a>
                          				<a class="btn btn-success btn-xs m-l " href="<{:U('Letter/index',array('uid'=>$v['post_uid']))}>">详细...</a>
                          				 
                          				<span class="text-muted m-l-sm pull-right">
                          					<i class="fa fa-clock-o"></i>&nbsp;<{$v['post_time']|beforeTime}> 
                          					<small> <eq name="v['is_read']" value="1"><span class="green-color"> [已读] </span><else/> [未读]</eq></small>
                          					<a class="button btn-xs btn-danger pull-right-lg m-l  btn-del" href="javascript:;" remove-parent=".box" data-url="<{:U('remove?id='.$v['id'])}>">删除</a>
                                 			<a class="button btn-xs btn-success  m-l  pull-right-lg  reply-letter"  href="javascript:;" data-reply="<{$v['id']}>" data-toid="<{$v['post_uid']}>">快速回复</a>
                          				</span>
                        			</header>
		                            <div class="panel-body">
		                            	<span class="arrow left"></span>
		                            	<p class="m-b-none"><{$v['content']|replace_expression}></p>
		                            </div>
		                   		</div>
		                   		<small class="text-muted"><i class="fa fa-ok text-success"></i></small>
		                	</section>
		            	</article>
		            	<notempty name="v['reply']">
                        <volist name="v['reply']" id="r">
                      	<article class="chat-item right" id="chat-id-2">
	                  		<a class="pull-right thumb-sm avatar" href="#"><img alt="..." class="img-circle" src="<{$r['post_uid']|get_user_avatar='128'}>"></a>
	                        <section class="chat-body">                      
		                    	<div class="panel bg-light text-sm m-b-none">
		                            <div class="panel-body">
		                            	<span class="arrow right"></span>
		                            	<p class="m-b-none"><{$r['content']|replace_expression}></p>
		                            </div>
		                    	</div>
		                    	<small class="text-muted"><{$v['post_time']|beforeTime}>   <{$v['post_uid']}></small>
	                        </section>
	              		</article>
	              		</volist>
                        </notempty>
	              		</volist>                         
                    </section>					
		        	<div class="list-page text-center"><ul class="pagination"><{$_page}></ul></div>              
                	<else />暂无私信！</if>				
                </section>
			</div>		
		</div>		
	</div>
</div>
		<script type="text/javascript" src="__STATIC__/expression/jquery.qqFace.js"></script>
		<script type="text/javascript">
			$(function(){
				$('#face1').qqFace({
					id : 'facebox1', //表情盒子的ID
					assign:'letter-content', //给那个控件赋值
					path:'__STATIC__/expression/face/',	//表情存放的路径
					addObj :'#letter-body'
				});
			});
		</script>
		<div class="modal fade " id="reply-letter" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
			<div class="modal-dialog">
			    <div class="modal-content padding-10">
			      	<div class="modal-header">
			        	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			        	<h5 class="modal-title" id="exampleModalLabel"><i class="soap-icon-letter green-color"></i> 回复私信</h5>
			    	</div>
			    	<form action="<{:U('Letter/post')}>"  method="post">
				      	<div class="modal-body padding-10" id="letter-body">
					      	<div class="faceBtn" id="face1" style="background:url(__STATIC__/expression/face.gif) 4px 4px no-repeat;">添加表情</div>					        
					    	<input type="hidden" value="" name="reply">
					        <input type="hidden" value="" name="toid">
							<div class="form-group">			                   
				                  <textarea id="letter-content" name="con" placeholder="4-500 个字符" class="input-text" style="width:100%" rows="3"></textarea>
				            </div>				                					       
				      	</div>
				      	<div class="modal-footer mt-0 padding-10">
				        	<button type="button" class="btn btn-sm btn-success ajax-post-letter">发 送</button>
				      	</div>
			      	</form>
			    </div>
			</div>

		</div>

</block>
